package site.assad.ditype;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/11/30 11:23
 * Description: 演示级联对象
 */
public class Article2 {
    private String title;
    private User user = new User();  //在 Article2 使用 User 作为级联对象时，必须将user声明为一个初始化对象；

    public Article2(String title, User user) {
        this.title = title;
        this.user = user;
    }

    public Article2() {
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Article{" +
                "title='" + title + '\'' +
                ", user=" + user +
                '}';
    }
}
